// package-star/pages/brand-setting-name/index.js
import { ManageTargetInfoUpdateMixins, ManageTargetInfoEditMixins } from '../../../behaviors/page';
import { tipToast } from '../../../common/env';

Page({
    mixins: [ManageTargetInfoUpdateMixins, ManageTargetInfoEditMixins],
    data: {
        value: '',
    },
    onLoad(options) {
        this.setData({
            value: this.data.manageTargetInfo.name,
        });
    },
    handleChange(e) {
        const { value } = e.detail;
        this.setData({
            value,
        });
    },
    async handleSave(e) {
        const { value } = this.data;
        if (!value) {
            tipToast('请输入品牌名称');
            return;
        }
        await this.manageTargetInfoUpdateAction({
            name: value,
        });
    },
})
